projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d8c9b9c
)
* lisp/treesit.el (treesit-node-at): Add check for nil node.
author
Yuan Fu
<casouri@gmail.com>
Fri, 13 May 2022 23:34:26 +0000
(16:34 -0700)
committer
Yuan Fu
<casouri@gmail.com>
Fri, 13 May 2022 23:34:26 +0000
(16:34 -0700)
lisp/treesit.el
patch
|
blob
|
history
diff --git
a/lisp/treesit.el
b/lisp/treesit.el
index 345aaf2e9b89c9d64e22896e9fc18415cfa0b530..60f375e9d9258f36137ba38f8028c8ea9ac5c212 100644
(file)
--- a/
lisp/treesit.el
+++ b/
lisp/treesit.el
@@
-143,7
+143,7
@@
that language in the current buffer, and use that."
(treesit-parser-root-node parser-or-lang)
(treesit-buffer-root-node parser-or-lang))))
;; TODO: We might want a `treesit-node-decendant-for-pos' in C.
- (while (cond ((
< (treesit-node-end node) point
)
+ (while (cond ((
and node (< (treesit-node-end node) point)
)
(setq node (treesit-node-next-sibling node))
t)
((treesit-node-child node 0 named)